# -*- mode: python -*-

Import("env")

env = env.Clone()

env.SConscript(
    must_exist=1,
    dirs=[
        "process_interface",
    ],
    exports=[
        "env",
    ],
)

env.Benchmark(
    target="document_source_group_bm",
    source=[
        "document_source_group_bm.cpp",
    ],
    LIBDEPS=[
        "$BUILD_DIR/mongo/db/query/query_test_service_context",
        "$BUILD_DIR/mongo/db/service_context_non_d",
        "$BUILD_DIR/mongo/db/service_context_test_fixture",
        "document_source_mock",
        "pipeline",
    ],
    CONSOLIDATED_TARGET="second_half_bm",
)

env.CppUnitTest(
    target="db_pipeline_test",
    source=[],
    LIBDEPS=[],
)

env.CppUnitTest(
    target="db_percentile_algo_test",
    source=[],
    LIBDEPS=[],
)

env.Benchmark(
    target="percentile_algo_bm",
    source=[
        "percentile_algo_bm_fixture.cpp",
    ],
    LIBDEPS=[
        "accumulator",
    ],
    CONSOLIDATED_TARGET="query_bm",
)

env.CppUnitTest(
    target="common_sort_key_optimization_test",
    source=[],
    LIBDEPS=[],
)

env.CppUnitTest(
    target="group_with_acc_n_optimization_test",
    source=[],
    LIBDEPS=[],
)

env.Benchmark(
    target="window_function_percentile_bm",
    source=[
        "window_function/window_function_percentile_bm_fixture.cpp",
    ],
    LIBDEPS=[
        "$BUILD_DIR/mongo/db/query/query_test_service_context",
        "$BUILD_DIR/mongo/db/service_context_non_d",
        "accumulator",
    ],
    CONSOLIDATED_TARGET="query_nond_bm",
)

env.Benchmark(
    target="window_function_concat_arrays_bm",
    source=[
        "window_function/window_function_concat_arrays_bm_fixture.cpp",
    ],
    LIBDEPS=[
        "$BUILD_DIR/mongo/db/query/query_test_service_context",
        "$BUILD_DIR/mongo/db/service_context_non_d",
        "accumulator",
    ],
    CONSOLIDATED_TARGET="query_nond_bm",
)

bmEnv = env.Clone()
bmEnv.InjectThirdParty(libraries=["benchmark"])

env.Benchmark(
    target="expression_bm",
    source=[],
    LIBDEPS=[],
)
